//
//  HomeViewController.m
//  JxCarios
//
//  Created by xcq on 15/1/20.
//  Copyright (c) 2015年 xiongchuanqi. All rights reserved.
//

#import "HomeViewController.h"
#import "HomeCollectionReusableView.h"
@implementation HomeViewController  
+(instancetype)getInstance{
    HomeViewController *vc= [[HomeViewController alloc] initWithNibName:@"HomeViewController" bundle:nil];
    return  vc;
}

- (void)viewDidLoad{
    [super viewDidLoad];
    [self.collectionView registerNib:[UINib nibWithNibName:@"HomeCollectionReusableView" bundle:nil] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"homeReusableView"];
    self.collectionView.delegate = self;
    self.collectionView.dataSource = self;
    self.collectionView.showsHorizontalScrollIndicator = NO;
    self.collectionView.showsVerticalScrollIndicator = NO;
    self.collectionView.contentInset = UIEdgeInsetsMake(0, 0, 50, 0);
    
     NSLog(@"HomeCollection:%@",NSStringFromCGRect(_collectionView.frame));
    NSLog(@"HomeView : %@" ,NSStringFromCGRect(self.view.frame));
}


-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
    return 0;
}



-(UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath
{
    HomeCollectionReusableView *reusableView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"homeReusableView" forIndexPath:indexPath];
    reusableView.backgroundColor = [UIColor redColor];
    NSLog(@"HomeCollectionReusableView:%@",NSStringFromCGRect(reusableView.frame));
    
   
    return reusableView;
}


@end
